Security News
The Unpaid Backbone of Open Source: Solo Maintainers Face Increasing Security Demands
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
List of all the available DOM and SVG nodes and helper functions to quickly test against them
$ npm i dom-nodes -S
import {isVoid} from 'dom-nodes'
isVoid('div') // false
isVoid('img') // true
dom-nodes
exports all the methods listed below giving you some simple tests to understand which kind of node you are dealing with.
This project includes html-tags and svg-tag-names directly in its source code avoiding to rely on third party npm modules for such simple list of strings. This project couldn't have been made without the projects above!
SVG void elements that cannot be auto-closed and shouldn't contain child nodes.
Type: Array
List of html elements where the value attribute is allowed
Type: Array
List of all the available svg tags
Type: Array
HTML void elements that cannot be auto-closed and shouldn't contain child nodes.
Type: Array
List of all the html tags
Type: Array
List of all boolean HTML attributes
Type: RegExp
Regex matching all the html tags ignoring the cases
Type: RegExp
Regex matching all the svg tags ignoring the cases
Type: RegExp
Regex matching all the void html tags ignoring the cases
Type: RegExp
Regex matching all the void svg tags ignoring the cases
Type: RegExp
Regex matching all the html tags where the value tag is allowed
Type: RegExp
Regex matching all the boolean attributes
Type: RegExp
True if it's a self closing tag
tag
string test tagisVoid('meta') // true
isVoid('circle') // true
isVoid('IMG') // true
isVoid('div') // false
isVoid('mask') // false
Returns boolean true if void
True if it's a known HTML tag
tag
string test tagisHtml('img') // true
isHtml('IMG') // true
isHtml('Img') // true
isHtml('path') // false
Returns boolean true if html tag
True if it's a known SVG tag
tag
string test tagisSvg('g') // true
isSvg('radialGradient') // true
isSvg('radialgradient') // true
isSvg('div') // false
Returns boolean true if svg tag
True if it's not SVG nor a HTML known tag
tag
string test tagisCustom('my-component') // true
isCustom('div') // false
Returns boolean true if custom element
True if the value attribute is allowed on this tag
tag
string test taghasValueAttribute('input') // true
hasValueAttribute('div') // false
Returns boolean true if the value attribute is allowed
True if it's a boolean attribute
attribute
string test attributeisBoolAttribute('selected') // true
isBoolAttribute('class') // false
Returns boolean true if the attribute is a boolean type
FAQs
List of all the available DOM and SVG nodes and helper functions to quickly test against them
The npm package dom-nodes receives a total of 922 weekly downloads. As such, dom-nodes popularity was classified as not popular.
We found that dom-nodes demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
Security News
License exceptions modify the terms of open source licenses, impacting how software can be used, modified, and distributed. Developers should be aware of the legal implications of these exceptions.
Security News
A developer is accusing Tencent of violating the GPL by modifying a Python utility and changing its license to BSD, highlighting the importance of copyleft compliance.